<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$this->config->item('charset');?>">
	<title>设置头像_<?=$this->config->item('site_name');?></title>

	<link href="<?=base_url('static/css/global.css')?>" rel="stylesheet" type="text/css" media="screen">
    <link href="<?=base_url('static/css/usercenter.css')?>" rel="stylesheet" type="text/css" media="screen">
	<script src="<?=path_res('static/js/jquery.js')?>"></script>
	<script src="<?=path_res('static/js/functions.js')?>"></script>

</head>
<body>

<? $this->load->view('header'); ?>
<div class="user_main clearfix">
    <div class="user_inner_tab">
        <a href="<?=site_url('u/'.$this->user_login->get_user_id())?>" class="user_backbtn1" title="返回我的空间" alt="返回我的空间"></a>
        <ul class="user_inner_tab_ul">
            <li><a href="<?=site_url('user/profile')?>" class="link">编辑个人资料</a></li>
            <li><a href="<?=site_url('user/portrait')?>" class="current link">设置头像</a></li>
            <li><a href="<?=site_url('user/change_password')?>" class="link">修改密码</a></li>
        </ul>
    </div>
    <div class="sixin_list">
        <div class="sixin_list_w">
            <div class="useredit_w">
                <div id="altContent"></div>
                <div id="avatar_priview"></div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="<?=base_url('static/js/FaustCplus/swfobject.js')?>"></script>
<script type="text/javascript">
            function uploadevent(status){
                 status += '';
                 switch(status){
                    case '1':
                        alert('头像设置成功!');
                        var time = new Date().getTime();
                    
                        // $.ajax({
                        //     url: "<?=site_url('user');?>",
                        //     success: function(result){
                               // alert(result);
                                //var msg=result.split("#");
                                //document.getElementById('avatar_priview').innerHTML = "小图: <img src='"+msg[0]+"?" + time + "'/> <br/> 原始图: <img src='"+msg[1]+"?" + time + "'/>";
                        //     }
                        // });
                        //window.location = "<?=site_url('user')?>"
                        //window.history.go(-1);
                    break;

                    case '2':
                        if(confirm('js call upload')){
                            return 1;
                        }else{
                            return 0;
                        }
                    break;

                    case '-1':
                        alert('cancel!');
                        window.location.href = "#";
                    break;
                    case '-2':
                        alert('upload failed!');
                        window.location.href = "#";
                    break;

                    default:
                        alert(typeof(status) + ' ' + status);
                } 
            }

            var flashvars = {
              "jsfunc":"uploadevent",
              "imgUrl":"<?=$user_pic?>",
              "pid":"75642723",
              "uploadSrc":true,
              "showBrow":true,
              "showCame":true,
              "pSize":"260|260|130|130|100|100",
              "uploadUrl":"<?=site_url('user/portrait/uploadavatar')?>"
            };

            var params = {
                menu: "false",
                scale: "noScale",
                allowFullscreen: "true",
                allowScriptAccess: "always",
                wmode:"transparent",
                bgcolor: "#FFFFFF"
            };

            var attributes = {
                id:"FaustCplus"
            };

        swfobject.embedSWF("<?=base_url('static/js/FaustCplus/FaustCplus.swf')?>", "altContent", "690", "500", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

</script>

	
<? $this->load->view('footer'); ?>